/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.cgb.portal.entity;

import br.cgb.portal.entity.enumeration.Country;
import br.cgb.portal.entity.enumeration.Sex;
import java.io.Serializable;
import java.util.Calendar;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author LUCAS
 */
@Entity(name = "\"USER\"")
@SequenceGenerator(name = "USER_GEN", sequenceName = "USER_GEN",
allocationSize = 1, initialValue = 1)
public class User implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "USER_GEN")
    private Long id;
    @Column(unique = true)
    private String email;
    @Column(nullable = false)
    private String password;
    @Enumerated(EnumType.ORDINAL)
    private Country country;
    @Column(length = 100)
    private String fullname;
    @Column(name = "paypal_account")
    private String paypalAccount;
    @Temporal(TemporalType.DATE)
    @Column(name = "birthday_date")
    private Calendar birthdayDate;
    @Enumerated(EnumType.ORDINAL)
    private Sex sex;
    @Column(name = "phone_number")
    private String phoneNumber;
    private Long credits;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "incoming_date")
    private Calendar incomingDate;
    private Boolean validated;

    public User() {
    }

    public User(String email, String password, Country country, String fullname, String paypalAccount, Calendar birthdayDate, Sex sex, String phoneNumber, Long credits, Calendar incomingDate, Boolean validated) {
        this.email = email;
        this.password = password;
        this.country = country;
        this.fullname = fullname;
        this.paypalAccount = paypalAccount;
        this.birthdayDate = birthdayDate;
        this.sex = sex;
        this.phoneNumber = phoneNumber;
        this.credits = credits;
        this.incomingDate = incomingDate;
        this.validated = validated;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Country getCountry() {
        return country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }

    public String getFullname() {
        return fullname;
    }

    public void setFullname(String fullname) {
        this.fullname = fullname;
    }

    public String getPaypalAccount() {
        return paypalAccount;
    }

    public void setPaypalAccount(String paypalAccount) {
        this.paypalAccount = paypalAccount;
    }

    public Calendar getBirthdayDate() {
        return birthdayDate;
    }

    public void setBirthdayDate(Calendar birthdayDate) {
        this.birthdayDate = birthdayDate;
    }

    public Sex getSex() {
        return sex;
    }

    public void setSex(Sex sex) {
        this.sex = sex;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public Long getCredits() {
        return credits;
    }

    public void setCredits(Long credits) {
        this.credits = credits;
    }

    public Calendar getIncomingDate() {
        return incomingDate;
    }

    public void setIncomingDate(Calendar incomingDate) {
        this.incomingDate = incomingDate;
    }

    public Boolean getValidated() {
        return validated;
    }

    public void setValidated(Boolean validated) {
        this.validated = validated;
    }
}
